<div class="clientes index">
	<h2><?php echo __('Filtro: Clientes Cadastrados'); ?></h2>
	
	<?php //echo $this->Form->create('Cliente', array('class' => 'formrelat')); ?>
	<form id="formFilterPrev" method="get" action="/site/relat_cadastrados/index" class="formFilterPrev" onsubmit="return validateDateSearch()">
	
		<div id="allfieldsSearch" style="width: 1000px; height: 100%;">
			
			<!-- -------------------------------------------- date line -------------------------------------------------- -->
			<div id="reportcadastradosdiv" style="width: 100%; height: 39px; padding: 0px; margin: 0px;">
						
				<div style="float: left; position:relative; width: 27%; height:42px; padding: 14px 0px 0px 20px; margin: 0px; clear: none; background: #BCD5B5; ">
					<div style=" width: 298px; height: 26px; padding: 0px; margin: 0px; vertical-align: middle; clear: none;">
						<div style="float: left; position:relative; width: 30%; height:25px; padding: 0px; margin: 0px; clear: none; padding-top: 2px;">
							<p style=" font-size: 15px; color: #003d4c; font-weight: bold; text-align:left; margin: 0px; ">Data de: </p>
						</div>
						<div style="float:left; position:relative; width: 67%; height:25px; padding: 0px; margin: 0px; clear: none;">
							<select id="tipo" name="tipo">
								<option value="0" <?php echo !(isset($_GET['tipo'])) || (isset($_GET['tipo']) && $_GET['tipo'] == '0') ? 'selected="selected"' : ''; ?> >Cadastro</option>
								<option value="1" <?php echo (isset($_GET['tipo']) && $_GET['tipo'] == 1) ? 'selected="selected"' : ''; ?>>Conferidos</option>
								<option value="2" <?php echo (isset($_GET['tipo']) && $_GET['tipo'] == 2) ? 'selected="selected"' : ''; ?>>Não conferidos</option>
							</select>
						</div>
						
					</div>
				</div>
				
				<div style="float: left; position:relative; width: 30%; height:42px; padding: 14px 0px 0px 20px; margin: 0px; clear: none; background: #BCD5B5; ">
					<div style=" width: 298px; height: 26px; padding: 0px; margin: 0px; vertical-align: middle; clear: none;">
						<div style="float: left; position:relative; width: 15%; height:25px; padding: 0px; margin: 0px; clear: none; padding-top: 2px; padding-right: 5px;">
							<p style=" font-size: 15px; color: #003d4c; font-weight: bold; text-align: left: ;">Entre: </p>
						</div>
						<div style="float:left; position:relative; width: 39%; height:25px; padding: 0px; margin: 0px; clear: none;">
							<input class="datepick" type="text" id="startdate" name="startdate" value="<?php echo isset($_GET['startdate']) ? $_GET['startdate'] : ''; ?>" style="width:85%; font-size: 15px;" maxlength="100" />
						</div>
						<div style="float: left; position:relative; width: 5%; height:25px; padding: 0px; margin: 0px; clear: none; padding-top: 2px; ">
							<p style=" font-size: 15px; color: #003d4c; font-weight: bold; text-align: left: ;"> e </p>
						</div>
						<div style="float:left; position:relative; width: 39%; height:25px; padding: 0px; margin: 0px; clear: none;">
							<input class="datepick" type="text" id="enddate" name="enddate" value="<?php echo isset($_GET['enddate']) ? $_GET['enddate'] : ''; ?>" style="width:85%; font-size: 15px;" maxlength="100" />
						</div>
					</div>
				</div>
				
				<div style="float: left; position:relative; width: 35%; height:42px; padding: 14px 0px 0px 0px; margin: 0px; clear: none; background: #BCD5B5;">
					<div style=" width: 298px; height: 26px; padding: 0px; margin: 0px; vertical-align: middle; clear: none; ">
						<div style="float: left; position:relative; width: 25%; height:25px; padding: 0px; margin: 0px; clear: none; padding-top: 2px; padding-right: 5px; ">
							<p style=" font-size: 15px; color: #003d4c; font-weight: bold; text-align: left: ;">Estados: </p>
						</div>
						<div style="float:left; position:relative; width: 72%; height:25px; padding: 0px; margin: 0px; clear: none;">
							<select id="ufId" name="ufId">
								<option value="0" <?php echo isset($_GET['ufId']) && $_GET['ufId'] == '0' ? 'selected="selected"' : '' ?>>Todos</option>
								<?php foreach ($ufs as $uf): ?>
									<option value="<?php echo $uf['Uf']['id']; ?>" <?php echo isset($_GET['ufId']) && $_GET['ufId'] == $uf['Uf']['id'] ? 'selected="selected"' : ''; ?>><?php echo $uf['Uf']['nome']; ?></option>
								<?php endforeach; ?>
							</select>
						</div>
					</div>
				</div>
			</div>
			<br>
			<br>
			<!-- -------------------------------------------- contrato line -------------------------------------------------- -->
			<div id="reportcadastradosdiv" style="width: 100%; height: 39px; padding: 0px; margin: 0px;">
						
				<div style="float: left; position:relative; width: 27%; height:42px; padding: 14px 0px 0px 20px; margin: 0px; clear: none; background: #BCD5B5; ">
					<div style=" width: 298px; height: 26px; padding: 0px; margin: 0px; vertical-align: middle; clear: none;">
						<div style="float: left; position:relative; width: 30%; height:25px; padding: 0px; margin: 0px; clear: none; padding-top: 2px;">
							<p style=" font-size: 15px; color: #003d4c; font-weight: bold; text-align:left; margin: 0px; ">Contrato: </p>
						</div>
						<div style="float:left; position:relative; width: 67%; height:25px; padding: 0px; margin: 0px; clear: none;">
							<input id="contratoId" name="contratoId" value="<?php echo isset($_GET['contratoId']) && $_GET['contratoId'] != '' ? $_GET['contratoId'] : ''; ?>" style="width:85%; font-size: 15px;" maxlength="100" onkeypress="onlyNumbers(event)" />
						</div>
						
					</div>
				</div>
				
				<div style="float: left; position:relative; width: 20%; height:42px; padding: 14px 0px 0px 20px; margin: 0px; clear: none; background: #BCD5B5; ">
					<div style=" width: 298px; height: 26px; padding: 0px; margin: 0px; vertical-align: middle; clear: none;">
						<div style="float: left; position:relative; width: 15%; height:25px; padding: 0px; margin: 0px; clear: none; padding-top: 2px; padding-right: 5px;">
							<p style=" font-size: 15px; color: #003d4c; font-weight: bold; text-align: left: ;">CPF: </p>
						</div>
						<div style="float:left; position:relative; width: 80%; height:25px; padding: 0px; margin: 0px; clear: none;">
							<input id="cpf" name="cpf" value="<?php echo isset($_GET['cpf']) && $_GET['cpf'] != '' ? $_GET['cpf'] : ''; ?>" class="cpfsearchcliente" style="width:85%; font-size: 15px;" maxlength="14" />
						</div>
					</div>
				</div>
				
				<div style="float: left; position:relative; width: 44%; height:42px; padding: 14px 0px 0px 10px; margin: 0px; clear: none; background: #BCD5B5;">
					<div style=" width: 398px; height: 26px; padding: 0px; margin: 0px; vertical-align: middle; clear: none; ">
						<div style="float: left; position:relative; width: 20%; height:25px; padding: 0px; margin: 0px; clear: none; padding-top: 2px; padding-right: 5px; ">
							<p style=" font-size: 15px; color: #003d4c; font-weight: bold; text-align: left: ;">Nome: </p>
						</div>
						<div style="float:left; position:relative; width: 77%; height:25px; padding: 0px; margin: 0px; clear: none;">
							<input id="nome" name="nome" value="<?php echo isset($_GET['nome']) && $_GET['nome'] != '' ? $_GET['nome'] : ''; ?>" style="width:97%; font-size: 15px;" maxlength="100" />
						</div>
					</div>
				</div>
			</div>
			<br>
			<br>
			<!-- -------------------------------------------- conferidos line -------------------------------------------------- -->
			<div id="reportcadastradosdiv" style="width: 100%; height: 39px; padding: 0px; margin: 0px;">
						
				<div style="float: left; position:relative; width: 27%; height:42px; padding: 14px 0px 0px 20px; margin: 0px; clear: none; background: #BCD5B5; ">
					<!--  <div style=" width: 298px; height: 26px; padding: 0px; margin: 0px; vertical-align: middle; clear: none;">
						<div style="float: left; position:relative; width: 34%; height:25px; padding: 0px; margin: 0px; clear: none; padding-top: 2px;">
							<p style=" font-size: 15px; color: #003d4c; font-weight: bold; text-align:left; margin: 0px; ">Conferidos: </p>
						</div>
						<div style="float:left; position:relative; width: 10%; height:25px; padding: 5px 0px 0px 0px; margin: 0px; clear: none;">
							<input type="checkbox" id="nomecliente" name="data[Cliente][nome]" style="width:85%; font-size: 15px;" maxlength="100" />
						</div>
						<div style="float: left; position:relative; width: 20%; height:25px; padding: 0px; margin: 0px; clear: none; padding-top: 2px;">
							<p style=" font-size: 15px; color: #003d4c; font-weight: bold; text-align:left; margin: 0px; font-weight: bold; ">SIM </p>
						</div>
						<div style="float:left; position:relative; width: 10%; height:25px; padding: 5px 0px 0px 0px; margin: 0px; clear: none;">
							<input type="checkbox" id="nomecliente" name="data[Cliente][nome]" style="width:85%; font-size: 15px;" maxlength="100" />
						</div>
						<div style="float: left; position:relative; width: 20%; height:25px; padding: 0px; margin: 0px; clear: none; padding-top: 2px;">
							<p style=" font-size: 15px; color: #003d4c; font-weight: bold; text-align:left; margin: 0px; font-weight: bold; ">NÃO </p>
						</div>
						
					</div> -->
					<div style=" width: 298px; height: 26px; padding: 0px 0px 0px 80px; margin: 0px; vertical-align: middle; clear: none;">
						<div style="float:left; position:relative; width: 10%; height:25px; padding: 5px 0px 0px 0px; margin: 0px; clear: none;">
							<input type="checkbox" id="finalizado" name="finalizado" <?php echo isset($_GET['finalizado']) && $_GET['finalizado'] == true ? 'checked="checked"' : ''; ?> style="width:85%; font-size: 15px;" maxlength="100" />
						</div>
						<div style="float: left; position:relative; width: 34%; height:25px; padding: 0px; margin: 0px; clear: none; padding-top: 2px; padding-right: 5px;">
							<p style=" font-size: 15px; color: #003d4c; font-weight: bold; text-align: left: ;">Finalizados: </p>
						</div>
					</div>
				</div>
				
				<div style="float: left; position:relative; width: 30%; height:42px; padding: 14px 0px 0px 20px; margin: 0px; clear: none; background: #DBDBDB; ">
					
				</div>
				
				<div style="float: left; position:relative; width: 35%; height:42px; padding: 14px 0px 0px 0px; margin: 0px; clear: none; background: #BCD5B5;">
					<div style=" width: 298px; height: 26px; padding: 0px 0px 0px 80px; margin: 0px; vertical-align: middle; clear: none;">
						<div style="float:left; position:relative; width: 10%; height:25px; padding: 5px 0px 0px 0px; margin: 0px; clear: none;">
							<input type="checkbox" id="excluido" name="excluido" <?php echo isset($_GET['excluido']) && $_GET['excluido'] == true ? 'checked="checked"' : ''; ?> style="width:85%; font-size: 15px;" maxlength="100" />
						</div>
						<div style="float: left; position:relative; width: 54%; height:25px; padding: 0px; margin: 0px; clear: none; padding-top: 2px; padding-right: 5px;">
							<p style=" font-size: 15px; color: #003d4c; font-weight: bold; text-align: left: ;">Apenas Excluídos: </p>
						</div>
					</div>
				</div>
			</div>
			<br>
			<br>
			<!-- -------------------------------------------- entity line -------------------------------------------------- -->
			<div id="reportcadastradosdiv" style="width: 100%; height: 39px; padding: 0px; margin: 0px;">
						
				<div style="float: left; position:relative; width: 94%; height:42px; padding: 14px 0px 0px 20px; margin: 0px; clear: none; background: #BCD5B5; ">
					<div style=" width: 298px; height: 26px; padding: 0px; margin: 0px; vertical-align: middle; clear: none; ">
						<div style="float: left; position:relative; width: 25%; height:25px; padding: 0px; margin: 0px; clear: none; padding-top: 2px; padding-right: 5px; ">
							<p style=" font-size: 15px; color: #003d4c; font-weight: bold; text-align: left: ;">Entidade: </p>
						</div>
						<div style="float:left; position:relative; width: 72%; height:25px; padding: 0px; margin: 0px; clear: none;">
							
							<select id="entidadeId" name="entidadeId">
								<option value="0" <?php echo isset($_GET['entidadeId']) && $_GET['entidadeId'] == '0' ? 'selected="selected"' : ''; ?>>Todas</option>
								<?php foreach ($entidades as $entidade): ?>
									<option value="<?php echo $entidade['Entidade']['id']; ?>" <?php echo isset($_GET['entidadeId']) && $_GET['entidadeId'] == $entidade['Entidade']['id'] ? 'selected="selected"' : ''; ?>><?php echo $entidade['Entidade']['nome']; ?></option>
								<?php endforeach; ?>
							</select>
						</div>
					</div>
				</div>
			</div>
			<br>
			<br>
			<!-- -------------------------------------------- operadora line -------------------------------------------------- -->
			<div id="reportcadastradosdiv" style="width: 100%; height: 39px; padding: 0px; margin: 0px;">
						
				<div style="float: left; position:relative; width: 94%; height:42px; padding: 14px 0px 0px 20px; margin: 0px; clear: none; background: #DBDBDB; ">
					<div style=" width: 498px; height: 26px; padding: 0px; margin: 0px; vertical-align: middle; clear: none; ">
						<div style="float: left; position:relative; width: 30%; height:25px; padding: 0px; margin: 0px; clear: none; padding-top: 2px; padding-right: 5px; ">
							<p style=" font-size: 15px; color: #003d4c; font-weight: bold; text-align: left: ;">Operadora Saúde: </p>
						</div>
						<div style="float:left; position:relative; width: 67%; height:25px; padding: 0px; margin: 0px; clear: none;">
							
							<select id="saudeId" name="saudeId" style=" width: 100%;">
								<option value="0" <?php echo isset($_GET['saudeId']) && $_GET['saudeId'] == '0' ? 'selected="selected"' : ''; ?>>Todas</option>
								<?php foreach ($operadorassaude as $operadora): ?>
									<option value="<?php echo $operadora['Operadora']['id']; ?>" <?php echo isset($_GET['saudeId']) && $_GET['saudeId'] == $operadora['Operadora']['id'] ? 'selected="selected"' : ''; ?>><?php echo $operadora['Operadora']['nome']; ?></option>
								<?php endforeach; ?>
							</select>
						</div>
					</div>
				</div>
			</div>
			<!-- -------------------------------------------- report line -------------------------------------------------- -->
			<div id="reportcadastradosdiv" style="width: 100%; height: 39px; padding: 0px; margin: 0px;">
						
				<div style="float: left; position:relative; width: 27%; height:42px; padding: 10px 0px 7px 20px; margin: 0px; clear: none; background: #BCD5B5; ">
					<div style=" width: 298px; height: 26px; padding: 0px; margin: 0px; vertical-align: middle; clear: none;">
						<div style="float:left; position:relative; width: 97%; height:25px; padding: 5px 0px 0px 0px; margin: 0px; clear: none;">
							<input type="submit" id="filterButtoncliente"  value="FILTRAR" style="width:85%; font-size: 15px;" maxlength="100" onclick="setTargetSelf()" />
						</div>
					</div>
				</div>
				
				<div style="float: left; position:relative; width: 30%; height:42px; padding: 10px 0px 0px 20px; margin: 0px; clear: none; background: #FFFFFF; ">
					<div style=" width: 298px; height: 26px; padding: 0px; margin: 0px; vertical-align: middle; clear: none;">
						<div style="float:left; position:relative; width: 97%; height:25px; padding: 5px 0px 0px 0px; margin: 0px; clear: none; text-align: center;">
							<input type="submit" id="resetsearchButton" name="resetsearchButton" class="resetsearchButton"  value="LIMPAR BUSCA" style=" font-size: 12px;" onclick="setTargetSelf()" />
						</div>
					</div>
				</div>
				
				<div style="float: left; position:relative; width: 35%; height:42px; padding: 5px 0px 12px 0px; margin: 0px; clear: none; background: #BCD5B5;">
					<div style=" width: 298px; height: 26px; padding: 0px 0px 0px 40px; margin: 0px; vertical-align: middle; clear: none;">
						<div style="float:left; position:relative; width: 20%; height:42px; padding: 0px 0px 0px 0px; margin: 0px; clear: none;">
							<input type="radio" id="radioPDFreport" name="radioPDFreport" checked="checked" onclick="document.getElementById('radioXLSreport').checked = false" />
							<label style="font-size: 12px; font-weight:bold; color: #003d4c; padding-top: 5px;" >.PDF</label>
							<input type="radio" id="radioXLSreport" name="radioXLSreport" onclick="document.getElementById('radioPDFreport').checked = false"/>
							<label style="font-size: 12px; font-weight:bold; color: #003d4c; padding-top: 7px;">.XLS</label>
						</div>
						<div style="float:left; position:relative; width: 77%; height:42px; padding: 10px 0px 0px 0px; margin: 0px; clear: none;">
							<input type="submit" id="printreportButton" name="printreportButton" class="printreportButton" value="IMPRIMIR" style="width:85%; font-size: 15px;" onclick="setTargetBlank()" />
						</div>
					</div>
				</div>
			</div>
		</div>
		
		<?php
		
			$tipo = 0;
			$data = false;
			$ufID = 0;
			$contratoID = 0;
			$cpf= '';
			$nome = '';
			$finalizado = false;
			$excluido = false;
			$entidadeId = 0;
			$saudeId = 0;
			//$odontId = 0;
			//$seguroId = 0;
			
			// ---------------- type filter ------------------
			if(isset($_GET['tipo']) && $_GET['tipo'] == 1) {
				$tipo = 1;
			}
			if(isset($_GET['tipo']) && $_GET['tipo'] == 2) {
				$tipo = 2;
			}
			
			// ---------------- date filter ------------------
			if((isset($_GET['startdate']) & isset($_GET['enddate'])) && $_GET['startdate'] != '' & $_GET['enddate'] != '') {
				$data = true;
			}
			
			// ---------------- corretor filter ------------------
			if(isset($_GET['ufId']) && $_GET['ufId'] != '0') {
				$ufID = $_GET['ufId'];
			}
			
			// ------------- contrato cliente filter -------------------
			if(isset($_GET['contratoId']) && $_GET['contratoId'] != ''){
				$contratoID = $_GET['contratoId'];
			}
			
			// ------------- nome cliente filter -------------------
			if(isset($_GET['nome']) && $_GET['nome'] != '') {
				$nome = $_GET['nome'];
			}
			
			// ------------- cpf cliente filter -------------------
			if(isset($_GET['cpf']) && $_GET['cpf'] != ''){
				$cpf = $_GET['cpf'];
			}
			
			// ------------- finalizado cliente filter -------------------
			if(isset($_GET['finalizado']) && $_GET['finalizado'] != false){
				$finalizado = true;
			}
			
			// ------------- excluido cliente filter -------------------
			if(isset($_GET['excluido']) && $_GET['excluido'] != false){
				$excluido = true;
			}
			
			// ------------- entidade cliente filter -------------------
			if(isset($_GET['entidadeId']) && $_GET['entidadeId'] != '0'){
				$entidadeId = $_GET['entidadeId'];
			}
			
			// ------------- operadora saude cliente filter -------------------
			if(isset($_GET['saudeId']) && $_GET['saudeId'] != '0'){
				$saudeId = $_GET['saudeId'];
			}
			
			// ------------- operadora odont cliente filter -------------------
			/*if(isset($_GET['odontId']) && $_GET['odontId'] != '0'){
				$odontId = $_GET['odontId'];
			}
			
			// ------------- seguro cliente filter -------------------
			if(isset($_GET['seguroId']) && $_GET['seguroId'] != '0'){
				$seguroId = $_GET['seguroId'];
			}*/
			
			$url = ($nome != '' ? 'nome='.$nome : '').($tipo != 0 ? '&tipo='.$tipo : '').($data ? '&startdate='.$_GET['startdate'].'&enddate='.$_GET['enddate'] : '').($ufID != 0 ? '&corretorId='.$ufID : '')
							  .($contratoID != 0 ? '&contratoId='.$contratoID : '').($cpf != '' ? '&cpf='.$cpf : '').($finalizado ? '&finalizado=on' : '')
							  .($excluido ? '&excluido=on' : '').($entidadeId != 0 ? '&entidadeId='.$entidadeId : '').($saudeId != 0 ? '&saudeId='.$saudeId : '');
							  //.($odontId != 0 ? '&odontId='.$odontId : '').($seguroId != 0 ? '&seguroId='.$seguroId : '');
			
			$this->Paginator->options(array('url' => array('controller' => 'relat_cadastrados','action' => 'index', '?' => $url)));
			?>
		
	</form>
		
		
	
	<div id="paginator_bar"><?php echo $this->Paginator->counter(array('format' => __('Cadastros: {:start} a {:end} de um total de {:count}')));?></div>
	
	<table cellpadding="0" cellspacing="0">
	<tr>
			<th align="center" width="170"><?php echo $this->Paginator->sort('modified', 'Data Cadastro'); ?></th>
			<th><?php echo $this->Paginator->sort('nome', 'Nome'); ?></th>
			<th><?php echo $this->Paginator->sort('cpf', 'CPF'); ?></th>
			<th align="center"><?php echo $this->Paginator->sort('planosaude_id', 'Operadora'); ?></th>
			<th align="center"><?php echo $this->Paginator->sort('planosaude_id', 'Plano'); ?></th>
			<th align="center" width="40"><?php echo $this->Paginator->sort('uf_id', 'UF'); ?></th>
			<th align="center"><?php echo $this->Paginator->sort('fpagamento_id', 'Taxa'); ?></th>
			
			<th align="center" class="actions"><?php echo __('Ações'); ?></th>
	</tr>
	<?php
	foreach ($clientes as $cliente): ?>
	<tr>
		<td align="center"><?php echo h(date('d-m-Y H:i:s', strtotime($cliente['Cliente']['modified']))); ?>&nbsp;</td>
		<td><?php echo h($cliente['Cliente']['nome']); ?>&nbsp;</td>
		<td><?php echo h($cliente['Cliente']['cpf']); ?>&nbsp;</td>
		<?php //pr($cliente); ?>
		<td align="center">
			<?php echo h($cliente['Operadora']['nome']); ?>
		</td>
		<td align="center">
			<?php echo $this->Html->link($cliente['Planosaude']['titulo'], array('controller' => 'planosaudes', 'action' => 'view', $cliente['Planosaude']['id'])); ?>
		</td>
		<td align="center">
			<?php echo h($cliente['Uf']['abreviacao']); ?>
		</td>
		<td align="center">
			<?php echo h($cliente['Fpagamento']['nome']); ?>
		</td>
		
		<td align="center" class="actions">
			<?php
				if($cliente['Cliente']['excluido'] == false) {
					if ($cliente['Cliente']['finalizado'] == false) {
						if($cliente['Cliente']['conferido'] == true) {
							echo $this->Html->link(__('Finalizar'), array('controller' => 'relat_cadastrados', 'action' => 'index', $cliente['Cliente']['id']), array('class' => 'concludeProposalButton'));
						} else {
							echo $this->Html->link(__('Conferir'), array('controller' => 'relat_cadastrados', 'action' => 'index', $cliente['Cliente']['id']), array('class' => 'checkProposalButton'));
						}
						
					} else {
						echo "<span style=' color: red; '>FINALIZADO</span>";
					}
				} else {
					echo "<span style=' color: red; '><-------></span>";
				}
			 	 
			 ?>
			<?php
				if($cliente['Cliente']['excluido'] == false) {
					echo $this->Html->link(__('PDF'), array('controller' => 'relat_cadastrados', 'action' => 'showPDF', $cliente['Cliente']['id']), array('target' => '_blank'));
				} else {
					echo "<span style=' color: red; '><-------></span>";
				}
			
			 ?>
			<?php
				if ($cliente['Cliente']['excluido'] == false) {
					//echo $this->Html->link(__('Excluir'), array('controller' => 'relat_cadastrados', 'action' => 'view', $cliente['Cliente']['id']), array('class' => 'premoveProposalButton'));
					echo $this->Form->postLink(__('Excluir'), array('controller' => 'relat_cadastrados', 'action' => 'view', $cliente['Cliente']['id']), array('class' => 'premoveProposalButton'), __('Tem certeza que deseja excluir a Proposta No.: '.$cliente['Cliente']['id'].'?', $cliente['Cliente']['id']));
				} else {
					echo "<span style=' color: red; '>EXCLUÍDO</span>";
				} 
			?>
		</td>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	//echo $this->Paginator->counter(array('format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')));
	?>	</p>

	<div class="paging">
	<?php
		if (!empty($this->passedArgs)) {
			$this->passedArgs['?'] = $url;
			$this->Paginator->options(array('url' => $this->passedArgs));
		}
	
		echo $this->Paginator->first(__('<<', true), array('class' => 'number-first'));
		echo $this->Paginator->prev(__('<'), array(), null, array('class' => 'prev disabled'));
		echo $this->Paginator->numbers(array('separator' => ''));
		echo $this->Paginator->next(__('>'), array(), null, array('class' => 'next disabled'));
		echo $this->Paginator->last(__('>>', true), array('class' => 'number-end'));
	?>
	</div>
</div>
<div class="main_menu_div">
	<h3><?php echo __('HOME'); ?></h3>
	<ul id="accordion">
		<li id="main_menu">Cadastro</li>
		<ul>
			<li><?php echo $this->Html->link(__('Anexos E-mail'), array('controller' => 'anexoemails', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Arquivos de Termos'), array('controller' => 'arquivotermos', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Bancos'), array('controller' => 'bancos', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Categorias'), array('controller' => 'categorias', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Corretores'), array('controller' => 'corretors', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Entidades'), array('controller' => 'entidades', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Estados'), array('controller' => 'ufs', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Estado Civil'), array('controller' => 'estadocivils', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Formas de Pagamento'), array('controller' => 'fpagamentos', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Imagens'), array('controller' => 'imagems', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Operadoras'), array('controller' => 'operadoras', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Operadoras Detalhes'), array('controller' => 'operadoradetalhes', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Órgãos'), array('controller' => 'orgaos', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Parcelas'), array('controller' => 'parcelas', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Parentesco'), array('controller' => 'parentescos', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Perfil Servidor'), array('controller' => 'perfilservidors', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Profiles'), array('controller' => 'profiles', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Planos de Saúde'), array('controller' => 'planosaudes', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Preços'), array('controller' => 'precos', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Seguradoras'), array('controller' => 'segurovidas', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Sindicatos'), array('controller' => 'sindicatos', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Situação Servidor'), array('controller' => 'statusservidors', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Sub-Entidades'), array('controller' => 'subentidades', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Tipos de Cliente'), array('controller' => 'tipoclientes', 'action' => 'index')); ?> </li>
			
		</ul>
		<li id="main_menu">Vínculos</li>
		<ul>
			<li><?php echo $this->Html->link(__('Entidades'), array('controller' => 'vinc_entidades', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Formas de Pagamento'), array('controller' => 'vinc_pagamentos', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Parentescos'), array('controller' => 'vinc_parentescos', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Sindicato'), array('controller' => 'vinc_sindicatos', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Odontológico'), array('controller' => 'vinc_odontologicos', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Estados'), array('controller' => 'vinc_ufs', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Categorias'), array('controller' => 'vinc_categorias', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Órgãos'), array('controller' => 'vinc_orgaos', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Corretores'), array('controller' => 'vinc_corretors', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Limpar Vínculos'), array('controller' => 'vinc_clears', 'action' => 'index')); ?> </li>
			
		</ul>
		<li id="main_menu">Relatórios</li>
		<ul>
			<li><?php echo $this->Html->link(__('Cadastrados'), array('controller' => 'relat_cadastrados', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Detalhado'), array('controller' => 'relat_detalhados', 'action' => 'index')); ?> </li>
			<li><?php echo $this->Html->link(__('Financeiro'), array('controller' => 'relat_financeiros', 'action' => 'index')); ?> </li>
		</ul>
		<li id="main_menu">Usuários</li>
		<ul>
			<li><?php echo $this->Html->link(__('Listar Usuários'), array('controller' => 'users', 'action' => 'index')); ?> </li>
		</ul>
	</ul>
</div>
